package chp03.menu;

import java.util.Scanner;

public class Menu3 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.println("欢迎使用学生管理系统");
        System.out.println("1.登录");
        System.out.println("2.退出");
        System.out.print("请选择:");
        int choose = input.nextInt();
        if(choose == 1){
            //输入账号和密码进行验证
            //假设账号是 admin 密码是 1234
            //成功登录系统，才能看到菜单
            System.out.print("请输入用户名:");
            String username = input.next();
            System.out.print("请输入密码:");
            String password = input.next();
            if(username.equals("admin") && password.equals("1234")){
                System.out.println("\n成功进入系统");
                System.out.println("1.新增学生");
                System.out.println("2.修改学生");
                System.out.println("3.查询学生");
                System.out.println("4.删除学生");
                System.out.print("请选择:");
                choose = input.nextInt();
            }else{
                System.out.println("登录失败");
            }
        }else{
            System.out.println("再见");
        }
    }
}
